<?php
/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Gmap
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */
 
?>

<script type="text/javascript">
window.addEvent("load", function(){
  $$('li.tab_layout_gmap_profile_gmaps').addEvent('click', function(){
      <?php echo $this->google_map->getInitializeJsFunctionName();?>();
  });
});
</script>

<div class="gmaps_widget_profile_gmaps_map_wrapper">
      <?php echo $this->gmapMarkers($this->google_map, $this->paginator, array(
        'width' => '100%',
        'height' => '400px',
      )); ?>
</div>
      
<ul class="gmaps_profile_tab">
  <?php foreach( $this->paginator as $item ): ?>
    <li>
      <?php if ($this->show_photo): ?>
        <div class='gmap_photo'>
          <?php echo $this->htmlLink($item->getHref(), $this->itemPhoto($item, 'thumb.icon')) ?>
        </div>
      <?php endif; ?>  
        <div class="gmap_info">    
          <div class='gmap_title'>
            <?php echo $this->htmlLink($item->getHref(), $item->getTitle()) ?>
          </div>  
          <div class="gmap_address">
            <?php echo $this->gmapAddressLink($this->google_map, $item)?>
          </div>
          <?php if ($this->show_details): ?>
	          <div class='gmap_date'>
	            <?php echo $this->timestamp(strtotime($item->creation_date)) ?>
              - <?php echo $this->translate(array("%s view", "%s views", $item->view_count), $this->locale()->toNumber($item->view_count)); ?>
              - <?php echo $this->translate(array("%s comment", "%s comments", $item->comment_count), $this->locale()->toNumber($item->comment_count)); ?>
	          </div>    
          <?php endif; ?>   
        </div>   
    </li>
  <?php endforeach; ?>
</ul>

<div class="gmaps_profile_links">
  <?php echo $this->htmlLink($this->url(array('user_id' => Engine_Api::_()->core()->getSubject()->getIdentity()), 'gmap_list'), $this->translate("View %s's Gmaps", Engine_Api::_()->core()->getSubject()->getTitle()), array('class' => 'buttonlink item_icon_gmap')) ?>
</div>
